#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;

public class PluginSettingWindow : EditorWindow
{
    private PluginLanguage language;

    private void Awake()
    {
        language = PluginSetting.Instance.language;
        PluginSetting.InitPlugin();
    }

    [MenuItem("GameDesigner/PluginSettings")]
    static void Init()
    {
        var setting = GetWindow<PluginSettingWindow>();
        setting.maxSize = new Vector2(300, 100);
        setting.Show();
    }

    void OnGUI()
    {
        if (language != PluginSetting.Instance.language)
        {
            language = PluginSetting.Instance.language;
            PluginSetting.InitPlugin();
        }
        PluginSetting.Instance.language = (PluginLanguage)EditorGUILayout.EnumPopup(PluginSetting.Language["PluginLanguage"], PluginSetting.Instance.language);
    }
}
#endif